<div class="dux-tools">
  <div class="bread-head">栏目管理 <span class="small">管理网站全部栏目</span> </div>
  <br>
  <div class="tools-function clearfix">
    <div class="float-left"> <a class="button button-small bg-main icon-list" href="__APP__/category"> 栏目列表</a> </div>
    <?php if(model('user_group')->model_power('category','add')){ ?>
    <div class="button-group float-right"> <a class="button button-small bg-dot icon-plus dropdown-toggle"> 添加 <span class="downward"></span></a>
      <ul class="drop-menu pull-right">
        <li><a href="__APP__/product_category/add">添加产品栏目</a></li>
      	<!--foreach:{$model_list $vo}-->
        <li><a href="__APP__/{$vo.model}_category/add">添加{$vo.name}栏目</a></li>
        <!--{/foreach}-->
      </ul>
    </div>
    <?php } ?>
  </div>
</div>
<div class="admin-main">
  <form method="post" class="form-x dux-form form-auto" id="form" action="__URL__/{$action}_save/time-<?php echo time(); ?>-ajax-true">
    <div class="panel dux-box  active">
      <div class="panel-head"> <strong>{$action_name}栏目</strong> </div>
      <div class="panel-body">
        <div class="form-group">
          <div class="label">
            <label>上级栏目</label>
          </div>
          <div class="field">
             <select name="pid" id="pid" class="input">
            <option value="0">=====顶级栏目=====</option>
            <!--foreach:{$category_list $vo}-->
            <!--if:{$info}-->
            <option <!--if:{$vo['cid']==$info['pid']}-->selected="selected"<!--{/if}-->  value="{$vo.cid}">{$vo.cname}</option>
            <!--{else}-->
            <option  <!--if:{$vo['cid']==$id}-->selected="selected"<!--{/if}--> value="{$vo.cid}">{$vo.cname}</option>
            <!--{/if}-->
            <!--{/foreach}-->
        </select>
            <div class="input-note">分类上级栏目</div>
          </div>
        </div>
        <?php if($info){ ?>
        <div class="form-group">
          <div class="label">
            <label>栏目名称</label>
          </div>
          <div class="field">
            <input name="name" type="text" size="60" class="input" id="name" value="{$info.name}" reg="\S" msg="栏目名称不能为空" />
            <div class="input-note"></div>
          </div>
        </div>
        <?php }else{ ?>
        <div class="form-group">
          <div class="label">
            <label>栏目名称</label>
          </div>
          <div class="field">
            <textarea name="namelist" class="input" id="namelist" rows="3" cols="62"  reg="\S" msg="栏目名称不能为空" ></textarea>
            <div class="input-note">批量添加一行一个栏目名,每行格式为名称|URL名称</div>
          </div>
        </div>
        <?php } ?>
        <div class="form-group">
          <div class="label">
            <label>SEO标题</label>
          </div>
          <div class="field">
            <input name="subname" type="text" size="60" class="input" id="subname" value="{$info.subname}" />
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>SEO关键词</label>
          </div>
          <div class="field">
             <textarea name="keywords" class="input" id="keywords" rows="3" cols="62" >{$info.keywords}</textarea>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>SEO描述</label>
          </div>
          <div class="field">
           <textarea name="description" class="input" rows="3" cols="62" id="description" >{$info.description}</textarea>
          </div>
        </div>
        <?php if($info){ ?>
        <div class="form-group">
          <div class="label">
            <label>栏目URL优化</label>
          </div>
          <div class="field">
           <input name="urlname" type="text" size="60" class="input" id="urlname" value="{$info.urlname}" />
          </div>
        </div>
        <?php } ?>
        <div class="form-group">
          <div class="label">
            <label>栏目形象图</label>
          </div>
          <div class="field">
           <?php echo module('editor')->get_image_upload('image1','image') ?>
          <input name="image" type="text" class="input" id="image" style="width:200px; float:left" value="{$info.image}"/>
          &nbsp;&nbsp;<input type="button" id="image1" class="button_small" value="选择图片" />
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>SEO优化内容</label>
          </div>
          <div class="field">
           <textarea name="seo_content" class="input" rows="3" cols="62" id="seo_content" >{$info.seo_content}</textarea>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label for="sitename">栏目显示</label>
          </div>
          <?php if(!isset($info['show'])){ $info['show']=1; } ?>
          <div class="field">
            <div class="button-group button-group-small radio">
            <?php if($info['show']){ ?>
              <label class="button active">
                <input name="show" value="1"   checked="checked" type="radio">
                <span class="icon icon-check"></span> 显示</label>
              <label class="button">
                <input name="show" value="0" type="radio">
                <span class="icon icon-times"></span> 隐藏</label>
            <?php }else{?>
              <label class="button">
                <input name="show" value="1" type="radio">
                <span class="icon icon-check"></span> 显示</label>
              <label class="button active">
                <input name="show" value="0" checked="checked" type="radio">
                <span class="icon icon-times"></span> 隐藏</label>
            <?php }?>    
            </div>
            <div class="input-note"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>内容分页数</label>
          </div>
          <div class="field">
            <input name="page" type="text" class="input" id="page" value="{$info.page isset="10"}" />
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>排序</label>
          </div>
          <div class="field">
            <input name="sequence" type="text" class="input" id="sequence" value="{$info.sequence isset="0"}" />
          <div class="input-note">数字越大越在前面</div></div>
          
        </div>
        <div class="form-group">
          <div class="label">
            <label>内容排序</label>
          </div>
          <div class="field">
            <select name="content_order" class="input">
          <option <!--if:{$info['content_order']=='updatetime DESC'}--> selected="selected" <!--{/if}--> value="updatetime DESC">内容更新时间 新-旧</option>
          <option <!--if:{$info['content_order']=='updatetime ASC'}--> selected="selected" <!--{/if}--> value="updatetime ASC">内容更新时间 旧-新</option>
          <option <!--if:{$info['content_order']=='inputtime DESC'}--> selected="selected" <!--{/if}--> value="inputtime DESC">内容发布时间 新-旧</option>
          <option <!--if:{$info['content_order']=='inputtime ASC'}--> selected="selected" <!--{/if}--> value="inputtime ASC">内容发布时间 旧-新</option>
          <option <!--if:{$info['content_order']=='sequence DESC'}--> selected="selected" <!--{/if}--> value="sequence DESC">内容自定义排序 大-小</option>
          <option <!--if:{$info['content_order']=='sequence ASC'}--> selected="selected" <!--{/if}--> value="sequence ASC">内容自定义排序 小-大</option>
        </select>
          <div class="input-note">针对该栏目下内容的排序方式</div></div>
          
        </div>
        <!--hook-->
        <?php module('common')->plus_hook('category','edit_tpl',$info);  ?>
      <!--hook end-->
        <div class="form-group">
          <div class="label">
            <label>栏目模板</label>
          </div>
          <div class="field">
            <input name="class_tpl" type="text" class="input" id="class_tpl" value="{$info.class_tpl isset="list.html"}"  />
          <div class="input-note">用于列表的显示</div></div>
          
        </div>
        <div class="form-group">
          <div class="label">
            <label>内容模板</label>
          </div>
          <div class="field">
           <input name="content_tpl" type="text" class="input" id="content_tpl" value="{$info.content_tpl isset="content.html"}"   />
          <div class="input-note">用于该栏目下的内容显示</div></div>
          
        </div>
      
      
      </div>
      <?php if(model('user_group')->model_power('category','add')||model('user_group')->model_power('category','edit')){ ?>
      <div class="panel-foot">
        <div class="form-button">
          <div id="tips"></div>
        	<input type="hidden" name="expand" value="{$info.expand}" />
            <input name="file_id" id="file_id" type="hidden" value="{$file_id}" />
            <input name="cid" type="hidden" value="{$info.cid}" />
          <button class="button bg-main" type="submit">保存</button>
          <button class="button bg" type="reset">重置</button>
        </div>
      </div>
    <?php } ?>
</div>
  </form>
{include file="category/common"}
</div>
